home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1277 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: kbad.eglin.af.mil!rpi!not-for-mail
  2. From: floydb1@lib104.its.rpi.edu (Barry B Floyd)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Creating a pointer to a function "void (*ptrFunction)()"  inside a class
  5. Date: 9 Jan 1996 15:18:24 -0500
  6. Organization: Rensselaer Polytechnic Institute, Troy, NY.
  7. Message-ID: <4cuiig$8hi@lib104.its.rpi.edu>
  8. References: <30ECA10F.3D99@ifu.net> <NITIN.96Jan5125830@more.eng.sun.com>  <4crquj$7t1@lib108.its.rpi.edu> <NITIN.96Jan9103242@more.eng.sun.com>
  9. NNTP-Posting-Host: lib104.its.rpi.edu
  10.  
  11.  
  12. In article <NITIN.96Jan9103242@more.eng.sun.com>, nitin@more.eng.sun.com (Nitin More [CONTRACTOR]) writes:
  13. |> > ps
  14. |> > 
  15. |> > note: "Function ( int, int )" remains virtual in DerivedClass,
  16. |> > even though the keyword "virtual" is not included in the declaration.
  17. |> > Thus, I believe "class DerivedDerivedClass : DerivedClass" must provide
  18. |> > a "Function ( int, int )" as well.
  19. |> 
  20. |> 
  21. |> I believe the last paragraph is wrong.  Somebody please correct me if I am
  22. |> wrong. 
  23. |> 
  24. |> (1) The "Function ( int, int )" *does not* remain virtual in DerivedClass
  25. |>     unless the keyword "virtual" is included in the declaration.
  26. |> 
  27. |> (2) The "class DerivedDerivedClass : DerivedClass" *does not* have to provide
  28. |>     a "Function ( int, int )" as well as long as one of its derived classes
  29. |>     has provided definition for the pure virtual function.
  30. |> 
  31. |> -Nitin
  32. |> 
  33. |> -- 
  34. |> ----------------------------------------------------------------------
  35. |> Nitin More                                                         
  36. |> SunSoft, Bldg 16  Off: (415) 786 7109                                 
  37. |> Menlo Park, CA    Fax: (415) 786 7957   e-mail: nitin@more.eng.sun.com
  38. |> ----------------------------------------------------------------------
  39.  
  40.  
  41. I may stand corrected, better minds please weigh in.
  42.  
  43. barry
  44. -- 
  45. +--------------------------------------------------------------------+ 
  46. | Barry B. Floyd                   \\\               floydb1@rpi.edu |
  47. | RPI Alum. '84 '87 '88              \\\                             |
  48. +--------------------------------------------------------------------+
  49.